package com.wongsi.spring5;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 编写一个Web应用
 */
@SpringBootApplication
public class Chapter5Bootstrap implements WebMvcConfigurer {

    public static void main(String[] args) {
        SpringApplication.run(Chapter5Bootstrap.class, args);
        System.out.println("启动成功 \n");
    }

    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        registry.addViewController("/").setViewName("home");
        registry.addViewController("/login");
    }
}
